<template>
  <el-dialog
    :model-value="visible"
    :width="344"
    :show-close="false"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    class="basic-dialog"
  >
    <div class="text-center text-xs text-[#333333]">
      程序版本更新，请刷新页面以获取最新的资源
    </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="handleRefresh"> 刷新 </el-button>
      </span>
    </template>
  </el-dialog>
</template>
<script lang="ts" setup>
interface IProp {
  visible: boolean
}
withDefaults(defineProps<IProp>(), {
  visible: false
})
interface IEmits {
  (event: 'update:visible', value: boolean): void
}
const emit = defineEmits<IEmits>()
const handleRefresh = () => {
  window.location.reload()
  emit('update:visible', false)
}
</script>
